<div class="left">
    <?php
    $this->breadcrumbs = array('Bản nhạc',);

    Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('song-grid', {
		data: $(this).serialize()
	});
	return false;
});
");

    function getRate($model)
    {
        $out = '';
        for ($i = 1; $i <= $model->star; $i++) {
            $out .= '<img src="' . Yii::app()->baseUrl . '/images/star.png">';
        }
        if ($model->rateCount) $out .= '<span style="line-height:16px;font-size:16px;margin-left:7px;">[ <span style="font-weight:bold;">' . $model->rateCount . '</span> ]</span>';
        return $out;
    }
    ?>



    <?php $this->widget('zii.widgets.grid.CGridView',
    array('id' => 'song-grid',
        'dataProvider' => $dataProvider,
        //'filter'=>$model,
        'columns' => array( //'id',
            array('name' => 'title',
                'value' => 'CHtml::link($data->title,Yii::app()->createUrl("song/view",array("id"=>$data->id,"title"=>Yii::app()->func->safeTitle($data->title))));',
                'type' => 'html'
            ),
            'singer',
            /*array(
                'name' => 'create_time',
                'value'=> 'date("d/m/Y H:i",$data->create_time)'
            ),*/
            array('header' => 'Đánh giá',
                'value' => 'getRate($data)',
                'type' => 'html'
            ),
            'view',
            /*array('name' => 'user_id',
                             'value'=> '$data->user->username'
            ),*/
        ),'summaryText'=>'Danh sách bản nhạc (Lyrics + Tabs)'
    ));
    ?>
</div>
<div class="right">
    <?php
    $this->beginWidget('zii.widgets.CPortlet', array('title' => 'Cơ sở đào tạo'));
    $this->widget('FacilityList', array());
    $this->endWidget();
    ?>
</div>